package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarCategoryMapper;
import com.ruoyi.system.domain.CarCategory;
import com.ruoyi.system.service.ICarCategoryService;

/**
 * 吊车分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-09
 */
@Service
public class CarCategoryServiceImpl implements ICarCategoryService 
{
    @Autowired
    private CarCategoryMapper carCategoryMapper;

    /**
     * 查询吊车分类
     * 
     * @param id 吊车分类主键
     * @return 吊车分类
     */
    @Override
    public CarCategory selectCarCategoryById(Long id)
    {
        return carCategoryMapper.selectCarCategoryById(id);
    }

    /**
     * 查询吊车分类列表
     * 
     * @param carCategory 吊车分类
     * @return 吊车分类
     */
    @Override
    public List<CarCategory> selectCarCategoryList(CarCategory carCategory)
    {
        return carCategoryMapper.selectCarCategoryList(carCategory);
    }

    /**
     * 新增吊车分类
     * 
     * @param carCategory 吊车分类
     * @return 结果
     */
    @Override
    public int insertCarCategory(CarCategory carCategory)
    {
        carCategory.setCreateTime(DateUtils.getNowDate());
        return carCategoryMapper.insertCarCategory(carCategory);
    }

    /**
     * 修改吊车分类
     * 
     * @param carCategory 吊车分类
     * @return 结果
     */
    @Override
    public int updateCarCategory(CarCategory carCategory)
    {
        carCategory.setUpdateTime(DateUtils.getNowDate());
        return carCategoryMapper.updateCarCategory(carCategory);
    }

    /**
     * 批量删除吊车分类
     * 
     * @param ids 需要删除的吊车分类主键
     * @return 结果
     */
    @Override
    public int deleteCarCategoryByIds(Long[] ids)
    {
        return carCategoryMapper.deleteCarCategoryByIds(ids);
    }

    /**
     * 删除吊车分类信息
     * 
     * @param id 吊车分类主键
     * @return 结果
     */
    @Override
    public int deleteCarCategoryById(Long id)
    {
        return carCategoryMapper.deleteCarCategoryById(id);
    }
}
